﻿using System;
using System.IO;
using UnityEngine;

namespace SEXY
{
	// Token: 0x02000291 RID: 657
	[Serializable]
	public class HSColorSet
	{
		// Token: 0x17000198 RID: 408
		// (get) Token: 0x060010EC RID: 4332 RVA: 0x0006B400 File Offset: 0x00069600
		public Color rgbaDiffuse
		{
			get
			{
				return HsvColor.ToRgba(this.hsvDiffuse, this.alpha);
			}
		}

		// Token: 0x17000199 RID: 409
		// (get) Token: 0x060010ED RID: 4333 RVA: 0x0006B414 File Offset: 0x00069614
		public Color rgbDiffuse
		{
			get
			{
				return HsvColor.ToRgb(this.hsvDiffuse);
			}
		}

		// Token: 0x1700019A RID: 410
		// (get) Token: 0x060010EE RID: 4334 RVA: 0x0006B424 File Offset: 0x00069624
		public Color rgbSpecular
		{
			get
			{
				return HsvColor.ToRgb(this.hsvSpecular);
			}
		}

		// Token: 0x060010EF RID: 4335 RVA: 0x0006B434 File Offset: 0x00069634
		public static bool CheckSameColor(HSColorSet a, HSColorSet b, bool hsv, bool alpha, bool specular)
		{
			if (alpha && a.alpha != b.alpha)
			{
				return false;
			}
			if (hsv && (a.hsvDiffuse.H != b.hsvDiffuse.H || a.hsvDiffuse.S != b.hsvDiffuse.S || a.hsvDiffuse.V != b.hsvDiffuse.V))
			{
				return false;
			}
			if (specular)
			{
				if (a.specularIntensity != b.specularIntensity)
				{
					return false;
				}
				if (a.specularSharpness != b.specularSharpness)
				{
					return false;
				}
				if (a.hsvSpecular.H != b.hsvSpecular.H || a.hsvSpecular.S != b.hsvSpecular.S || a.hsvSpecular.V != b.hsvSpecular.V)
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x060010F0 RID: 4336 RVA: 0x0006B534 File Offset: 0x00069734
		public void SetDiffuseRGBA(Color rgba)
		{
			this.hsvDiffuse = HsvColor.FromRgb(rgba);
			this.alpha = rgba.a;
		}

		// Token: 0x060010F1 RID: 4337 RVA: 0x0006B550 File Offset: 0x00069750
		public void SetDiffuseRGB(Color rgb)
		{
			this.hsvDiffuse = HsvColor.FromRgb(rgb);
			this.alpha = 1f;
		}

		// Token: 0x060010F2 RID: 4338 RVA: 0x0006B56C File Offset: 0x0006976C
		public void SetSpecularRGB(Color rgb)
		{
			this.hsvSpecular = HsvColor.FromRgb(rgb);
		}

		// Token: 0x060010F3 RID: 4339 RVA: 0x0006B57C File Offset: 0x0006977C
		public void Copy(HSColorSet src)
		{
			this.hsvDiffuse = new HsvColor(src.hsvDiffuse.H, src.hsvDiffuse.S, src.hsvDiffuse.V);
			this.alpha = src.alpha;
			this.hsvSpecular = new HsvColor(src.hsvSpecular.H, src.hsvSpecular.S, src.hsvSpecular.V);
			this.specularIntensity = src.specularIntensity;
			this.specularSharpness = src.specularSharpness;
		}

		// Token: 0x060010F4 RID: 4340 RVA: 0x0006B608 File Offset: 0x00069808
		public void Load(BinaryReader reader, int version)
		{
			this.hsvDiffuse.H = (float)reader.ReadDouble();
			this.hsvDiffuse.S = (float)reader.ReadDouble();
			this.hsvDiffuse.V = (float)reader.ReadDouble();
			this.alpha = (float)reader.ReadDouble();
			this.hsvSpecular.H = (float)reader.ReadDouble();
			this.hsvSpecular.S = (float)reader.ReadDouble();
			this.hsvSpecular.V = (float)reader.ReadDouble();
			this.specularIntensity = (float)reader.ReadDouble();
			this.specularSharpness = (float)reader.ReadDouble();
		}

		// Token: 0x04001205 RID: 4613
		public const int SaveVersion = 1;

		// Token: 0x04001206 RID: 4614
		public HsvColor hsvDiffuse = new HsvColor(19f, 0.07f, 0.63f);

		// Token: 0x04001207 RID: 4615
		public float alpha = 1f;

		// Token: 0x04001208 RID: 4616
		public HsvColor hsvSpecular = new HsvColor(0f, 0f, 0.8f);

		// Token: 0x04001209 RID: 4617
		public float specularIntensity = 0.1f;

		// Token: 0x0400120A RID: 4618
		public float specularSharpness = 0.33f;
	}
}
